def gen_func():
    # try:
    #     yield "http://www.test.com"
    # except GeneratorExit:
    #     pass
    yield "http://www.test.com"
    yield 1
    yield 2
    yield 3


if __name__ == '__main__':
    gen = gen_func()
    print(next(gen))
    gen.close()
    next(gen)